const gpio_0 = 14
const gpio_1 = 15
const gpio_2 = 16
const gpio_3 = 17
const gpio_4 = 29

'Set up the DIO pins, enable the internal weak pullup resistors
setpin gpio_0, din, pullup
setpin gpio_1, din, pullup
setpin gpio_2, din, pullup
setpin gpio_3, din, pullup
setpin gpio_4, din, pullup

print "Press any key to START. Once started press any key to STOP""
do
loop until inkey$ <>""

do 
  if pin(gpio_0) = 0 then
    print "left:";
  end if

  if pin(gpio_1) = 0 then
    print "down:";
  end if

  if pin(gpio_2) = 0 then
    print "up:";
  end if

  if pin(gpio_3) = 0 then
    print "right:";
  end if

  if pin(gpio_4) = 0 then
    print "FIRE!"
  end if

  print
loop until inkey$ <> ""

end
